import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AppListService } from './app-list.service';
import { AppListController } from './app-list.controller';
import { ErrorHandlerMiddleware } from '../middleware/errorhandler';

@Module({
  providers: [AppListService],
  controllers: [AppListController],
})
export class AppListModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(ErrorHandlerMiddleware).forRoutes('*');
  }
}
